libxl: wait for qemu to acknowledge logdirty command
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 28 Jun 2012 17:43:23 +0000 (18:43 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 28 Jun 2012 17:43:23 +0000 (18:43 +0100)
commit0d176cc71600d74b2bd7dcb437ce4ce8c0033275
tree000838c166c010ccd058f3b83c8d5e8922758c31
parent68c6062f0cbfd61dbf8839a1b721ea3c00072f26
libxl: wait for qemu to acknowledge logdirty command

The current migration code in libxl instructs qemu to start or stop
logdirty, but it does not wait for an acknowledgement from qemu before
continuing.  This might lead to memory corruption (!)

Fix this by waiting for qemu to acknowledge the command.

Unfortunately the necessary ao arrangements for waiting for this
command are unique because qemu has a special protocol for this
particular operation.

Also, this change means that the switch_qemu_logdirty callback
implementation in libxl can no longer synchronously produce its return
value, as it now needs to wait for xenstore.  So we tell the
marshalling code generator that it is a message which does not need a
reply.  This turns the callback function called by the marshaller into
one which returns void; the callback function arranges to later
explicitly sends the reply to the helper, when the xs watch triggers
and the appropriate value is read from xenstore.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_dom.c
tools/libxl/libxl_internal.h
tools/libxl/libxl_save_callout.c
tools/libxl/libxl_save_msgs_gen.pl